package com.lee.thread;

class MyThread extends Thread {
	private String threadName ;
	
	private int sleepTime;
	
	public MyThread(String threadName, int sleepTime) {
		super();
		this.threadName = threadName;
		this.sleepTime = sleepTime;
	}

	@Override
	public void run() {
		try {
			Thread.sleep(sleepTime);
			System.out.println("当前线程："+threadName+" 休眠了"+sleepTime+"毫秒");
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	
}

public class ThreadTest2 {
	public static void main(String[] args) {
		Thread thread1 = new MyThread("thread1", 5000);
		Thread thread2 = new MyThread("thread2", 3000);
		Thread thread3 = new MyThread("thread3", 4000);
		thread1.start();
		thread2.start();
		thread3.start();
	}
}
